package com.yuou.model;

import java.io.Serializable;
import java.util.Date;

import org.springframework.format.annotation.DateTimeFormat;

public class Blog implements Serializable{
    
	private static final long serialVersionUID = 1L;

	//主键
    private Integer id;
    //博客标题 
    private String title;
    //博客简介/摘要 
    private String introduction;
    //关键字 
    private String keyword;
    //排序虚拟字段 
    private String sort;
    //封面缩略图等 
    private String images;
    //点击量 
    private Integer clicknum;
    //评论量 
    private Integer commentnum;
    //点赞量 
    private Integer agreenum;
    //1置顶，0普通 
    private Integer istop;

    //博主推荐,1为推荐，0为普通 
    private Integer isrecommend;

    //更新日期
    @DateTimeFormat(pattern="yyyy-MM-dd hh:mm:ss")
    private Date updatetime;
    //创建日期
    @DateTimeFormat(pattern="yyyy-MM-dd hh:mm:ss")
    private Date addtime;
    //状态-1为草稿，1为正文 ，2为回收站
    private Integer status;
    //类别 
    private BlogType type;
    //博客内容 
    private String content;

	public Blog(Integer id, String title, String introduction, String keyword,
			String images, Integer clicknum, Integer commentnum,
			Integer agreenum, Integer istop, Integer isrecommend,
			Date updatetime, Date addtime, Integer status, BlogType type,
			String content) {
		super();
		this.id = id;
		this.title = title;
		this.introduction = introduction;
		this.keyword = keyword;
		this.images = images;
		this.clicknum = clicknum;
		this.commentnum = commentnum;
		this.agreenum = agreenum;
		this.istop = istop;
		this.isrecommend = isrecommend;
		this.updatetime = updatetime;
		this.addtime = addtime;
		this.status = status;
		this.type = type;
		this.content = content;
	}

	public Blog() {
	}
	public String getSort() {
		return sort;
	}

	public void setSort(String sort) {
		this.sort = sort;
	}
    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title == null ? null : title.trim();
    }

    public String getIntroduction() {
        return introduction;
    }

    public void setIntroduction(String introduction) {
        this.introduction = introduction == null ? null : introduction.trim();
    }

    public String getKeyword() {
        return keyword;
    }

    public void setKeyword(String keyword) {
        this.keyword = keyword == null ? null : keyword.trim();
    }

    public String getImages() {
        return images;
    }

    public void setImages(String images) {
        this.images = images == null ? null : images.trim();
    }

    public Integer getClicknum() {
        return clicknum;
    }

    public void setClicknum(Integer clicknum) {
        this.clicknum = clicknum;
    }

    public Integer getCommentnum() {
        return commentnum;
    }

    public void setCommentnum(Integer commentnum) {
        this.commentnum = commentnum;
    }

    public Integer getAgreenum() {
        return agreenum;
    }

    public void setAgreenum(Integer agreenum) {
        this.agreenum = agreenum;
    }

    public Integer getIstop() {
        return istop;
    }

    public void setIstop(Integer istop) {
        this.istop = istop;
    }

    public Integer getIsrecommend() {
        return isrecommend;
    }

    public void setIsrecommend(Integer isrecommend) {
        this.isrecommend = isrecommend;
    }

    public Date getUpdatetime() {
        return updatetime;
    }

    public void setUpdatetime(Date updatetime) {
        this.updatetime = updatetime;
    }

    public Date getAddtime() {
        return addtime;
    }

    public void setAddtime(Date addtime) {
        this.addtime = addtime;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }
    
	public BlogType getType() {
		return type;
	}
	
	public void setType(BlogType type) {
		this.type = type;
	}

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content == null ? null : content.trim();
    }

	@Override
	public String toString() {
		return "Blog [id=" + id + ", title=" + title + ", introduction="
				+ introduction + ", keyword=" + keyword + ", images=" + images
				+ ", clicknum=" + clicknum + ", commentnum=" + commentnum
				+ ", agreenum=" + agreenum + ", istop=" + istop
				+ ", isrecommend=" + isrecommend + ", updatetime=" + updatetime
				+ ", addtime=" + addtime + ", status=" + status + ", type=[id="
				+ type.getId() + ",typeName="+type.getTypename()+",content=" + content + "]";
	}

	
       
}